#!/bin/bash
apt update
apt install -y git zsh nvme-cli dstat sysstat glances smartmontools lm-sensors lrzsz iotop pv gdisk htop nfs-common coreutils progress nvme-cli lsscsi net-tools python3-pip

git config --global url."https://".insteadOf git://
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/plugins/zsh-syntax-highlighting
git clone git://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/plugins/zsh-autosuggestions


cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
sed -i "s/robbyrussell/ys/g" ~/.zshrc
sed -i "s/plugins=(git)/plugins=(git z zsh-autosuggestions zsh-syntax-highlighting docker docker-compose)/g" ~/.zshrc
#sed -i "1i ZSH_DISABLE_COMPFIX=\"true\"" ~/.zshrc

chown -R ubuntu:ubuntu /home/ubuntu/

command -v zsh | sudo tee -a /etc/shells
chsh -s /bin/zsh
#chsh -s $(which zsh) ubuntu

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo Asia/Shanghai > /etc/timezone
echo "time zone:"
cat /etc/timezone

touch /etc/sudoers.d/ubuntu
echo "%ubuntu ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/ubuntu
chmod 0440 /etc/sudoers.d/ubuntu

curl -fsSL get.docker.com -o get-docker.sh && sudo sh get-docker.sh --mirror Aliyun

curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3

pip install docker-compose
